//package com.typhoon.condition;
//
//import org.springframework.beans.BeansException;
//import org.springframework.beans.factory.config.BeanPostProcessor;
//import org.springframework.context.ApplicationContext;
//import org.springframework.context.ApplicationContextAware;
//
//import java.util.HashSet;
//import java.util.Map;
//import java.util.Set;
//
///**
// * @author typhoon
// * @Description TODO
// * @date 2019-11-20 18:06
// * @since V2.0.0
// */
//public class ConditionGroupBeanPostProcessor implements BeanPostProcessor, ApplicationContextAware {
//
//
//
//    @Override
//    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
//        return null;
//    }
//
//    @Override
//    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
//
//
//        Map<String,IConditionGroup> groupBeans =  applicationContext.getBeansOfType(IConditionGroup.class);
//        Map<String,ICondition> conditionBeans = applicationContext.getBeansOfType(ICondition.class);
//        groupBeans.forEach((k,v) -> {
//             Set<ICondition> conditions = new HashSet<>();
//            for(Map.Entry<String,ICondition> entry:conditionBeans.entrySet()) {
//                if(entry.getValue().getGroup().contains(k)) {
//                    conditions.add(entry.getValue());
//                }
//            }
//
//            v.setConditions(conditions);
//
//        });
//
//    }
//}
